package com.apartment.own.service.impl;

import java.util.List;
import com.apartment.common.utils.DateUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.apartment.own.mapper.OwnOrdExtraChargeMapper;
import com.apartment.own.domain.OwnOrdExtraCharge;
import com.apartment.own.service.IOwnOrdExtraChargeService;

/**
 * 额外费用Service业务层处理
 * 
 * @author @Dog_E
 * @date 2020-08-28
 */
@Service
public class OwnOrdExtraChargeServiceImpl extends ServiceImpl<OwnOrdExtraChargeMapper,OwnOrdExtraCharge> implements IOwnOrdExtraChargeService
{
    @Autowired
    private OwnOrdExtraChargeMapper ownOrdExtraChargeMapper;

    /**
     * 查询额外费用
     * 
     * @param id 额外费用ID
     * @return 额外费用
     */
    @Override
    public OwnOrdExtraCharge selectOwnOrdExtraChargeById(Long id)
    {
        return ownOrdExtraChargeMapper.selectOwnOrdExtraChargeById(id);
    }

    /**
     * 查询额外费用列表
     * 
     * @param ownOrdExtraCharge 额外费用
     * @return 额外费用
     */
    @Override
    public List<OwnOrdExtraCharge> selectOwnOrdExtraChargeList(OwnOrdExtraCharge ownOrdExtraCharge)
    {
        return ownOrdExtraChargeMapper.selectOwnOrdExtraChargeList(ownOrdExtraCharge);
    }

    /**
     * 新增额外费用
     * 
     * @param ownOrdExtraCharge 额外费用
     * @return 结果
     */
    @Override
    public int insertOwnOrdExtraCharge(OwnOrdExtraCharge ownOrdExtraCharge)
    {
        ownOrdExtraCharge.setCreateTime(DateUtils.getNowDate());
        return ownOrdExtraChargeMapper.insertOwnOrdExtraCharge(ownOrdExtraCharge);
    }

    /**
     * 修改额外费用
     * 
     * @param ownOrdExtraCharge 额外费用
     * @return 结果
     */
    @Override
    public int updateOwnOrdExtraCharge(OwnOrdExtraCharge ownOrdExtraCharge)
    {
        ownOrdExtraCharge.setUpdateTime(DateUtils.getNowDate());
        return ownOrdExtraChargeMapper.updateOwnOrdExtraCharge(ownOrdExtraCharge);
    }

    /**
     * 批量删除额外费用
     * 
     * @param ids 需要删除的额外费用ID
     * @return 结果
     */
    @Override
    public int deleteOwnOrdExtraChargeByIds(Long[] ids)
    {
        return ownOrdExtraChargeMapper.deleteOwnOrdExtraChargeByIds(ids);
    }

    /**
     * 删除额外费用信息
     * 
     * @param id 额外费用ID
     * @return 结果
     */
    @Override
    public int deleteOwnOrdExtraChargeById(Long id)
    {
        return ownOrdExtraChargeMapper.deleteOwnOrdExtraChargeById(id);
    }
}
